package com.cloudwebrtc.voip.mediaengine.impl;

import com.cloudwebrtc.voip.mediaengine.MediaEngine;
import com.cloudwebrtc.voip.mediaengine.RTCVideoEngine;
import com.cloudwebrtc.voip.mediaengine.RTCVoiceEngine;

public class MediaEngineImpl implements MediaEngine {
	//implement for MediaEngine_JNI.cpp
	private long nativePtr = 0;
	private native long GetVoiceEngine(long nativePtr);
	private native long GetVideoEngine(long nativePtr);
	public MediaEngineImpl(long aNativePtr)
	{
		nativePtr = aNativePtr;
	}

	@Override
	public RTCVoiceEngine GetVoiceEngine() {
		long voiceEnginePtr = GetVoiceEngine(nativePtr);
		return new RTCVoiceEngineImpl(voiceEnginePtr);
	}

	@Override
	public RTCVideoEngine GetVideoEngine() {
		long videoEnginePtr = GetVideoEngine(nativePtr);
		return new RTCVideoEngineImpl(videoEnginePtr);
	}
}
